﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="Nivdal.MailInbox" Title="" StylesheetTheme="SkinFile"
    CodeBehind="MailInbox.aspx.cs" %>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, MailInbox_PageNameLabel %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="MessagesUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="basic_element">
            <div class="red_title">
                <asp:Label ID="NumOfMailsLabel" runat="server" CssClass="white_title"></asp:Label>
            </div>
            <div class="padding5">
                <asp:Label ID="InfoLabel" runat="server" SkinID="RedSmallHeaderLabel"></asp:Label>
                    
                <asp:Button ID="DeleteAllButton" runat="server" Text="<%$ Resources:Resource, Global_DeleteAll %>"
                    message="<%$ Resources:Resource, InternalTeamMessages_DeleteAllButtonOnClientClick %>" 
                    CssClass="GreenSmallButtonStyle" OnClientClick='return confirm(this.getAttribute("message"))'
                    OnClick="DeleteAll" />
                &nbsp;&nbsp;
                <asp:Button ID="DeleteSelectedButton" runat="server" Text="<%$ Resources:Resource, InternalTeamMessages_DeleteSelectedButtonText %>"
                    message="<%$ Resources:Resource, InternalTeamMessages_DeleteSelectedButtonOnClientClick %>"
                    CssClass="GreenSmallButtonStyle" OnClientClick='return confirm(this.getAttribute("message"))'
                    OnClick="DeleteSelected" />
                &nbsp;&nbsp;
                <asp:HyperLink ID="SentItemsHyperLink" runat="server" Text="<%$ Resources:Resource, MailInbox_SentItemsHyperLink %>"
                    SkinID="GreenTitleHyperLink" NavigateUrl="~/MailSentItems.aspx"></asp:HyperLink>
                <br /><br />
                
                <asp:UpdateProgress ID="MessagesUpdatePanelProgress" runat="server" AssociatedUpdatePanelID="MessagesUpdatePanel">
                    <ProgressTemplate>
                        <div class="ajaxloader">
                            <asp:Image ID="MessagesUpdatePanelProgressImage" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                        </div>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                
                    
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" SkinID="Professional"
                    OnRowCommand="Delete" AutoGenerateColumns="False" AllowPaging="True" Font-Size="13px"
                    EnableTheming="True" PageSize="20">
                    <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                        Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
                    <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
                    <Columns>
                        <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date %>">
                            <ItemTemplate>
                                <asp:HyperLink ID="DateHyperlink" runat="server" Font-Bold='<%# Eval("IsNotRead") %>'
                                    Text='<%# Eval("Date")%>' SkinID="BlackHyperLinkSkin" NavigateUrl='<%# Eval("MailId", "MailMessage.aspx?MailId={0}") %>'></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label ID="SubjectLabel" runat="server" Text="<%$ Resources:Resource, Global_Subject %>"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink2" runat="server" Font-Bold='<%# Eval("IsNotRead") %>'
                                    Text='<%# Eval("Subject") %>' NavigateUrl='<%# Eval("MailId", "MailMessage.aspx?MailId={0}") %>'
                                    SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label ID="FromLabel" runat="server" Text="<%$ Resources:Resource, Global_From %>"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink3" runat="server" Font-Bold='<%# Eval("IsNotRead") %>'
                                    Text='<%# Eval("From") %>' NavigateUrl='<%# Eval("FromId", "UserPage.aspx?Id={0}") %>'
                                    SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="10%">
                            <ItemTemplate>
                                <asp:HiddenField ID="MailIdHiddenField" runat="server" Value='<%# Eval("MailId") %>' />
                                <asp:ImageButton ID="DeleteMailButton" runat="server" ImageUrl="~/Images/Icons/delete.png"
                                    CommandArgument='<%# Eval("MailId") %>' CommandName="DeleteMail" ToolTip="<%$ Resources:Resource, Global_Delete %>" />
                                <asp:CheckBox ID="DeleteCheckBox" runat="server" Checked="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <br />                
            </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_GetMails" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    
</asp:Content>
